<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>分类: 使用教程 | 小小程序员</title><meta name="author" content="十一星野"><meta name="copyright" content="十一星野"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="已完成教程：  https:&#x2F;&#x2F;zhuanlan.zhihu.com&#x2F;p&#x2F;554333805 Hexo + Obsidian + Git 完美的博客部署与编辑方案 - 掘金 (juejin.cn)未完成教程：Hexo&amp;Obsidian不完全工作流 | 𝓐𝓮𝓻𝓸𝓼𝓪𝓷𝓭 (aerosand.cn)  1.目录结构 打开 obsition 2.忽略多余的文件我们主要是编辑和管理">
<meta property="og:type" content="article">
<meta property="og:title" content="Obsition + Hexo 上传">
<meta property="og:url" content="https://ko25891wan.gitlab.io/2023/11/fd3f0b9d3591.html">
<meta property="og:site_name" content="小小程序员">
<meta property="og:description" content="已完成教程：  https:&#x2F;&#x2F;zhuanlan.zhihu.com&#x2F;p&#x2F;554333805 Hexo + Obsidian + Git 完美的博客部署与编辑方案 - 掘金 (juejin.cn)未完成教程：Hexo&amp;Obsidian不完全工作流 | 𝓐𝓮𝓻𝓸𝓼𝓪𝓷𝓭 (aerosand.cn)  1.目录结构 打开 obsition 2.忽略多余的文件我们主要是编辑和管理">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/%E5%A4%B4%E5%83%8F/%E7%81%B0%E5%A4%AA%E7%8B%BC.png">
<meta property="article:published_time" content="2023-11-29T12:01:29.000Z">
<meta property="article:modified_time" content="2024-02-03T04:56:35.999Z">
<meta property="article:author" content="十一星野">
<meta property="article:tag" content="宅男,热血">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/%E5%A4%B4%E5%83%8F/%E7%81%B0%E5%A4%AA%E7%8B%BC.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://ko25891wan.gitlab.io/2023/11/fd3f0b9d3591.html"><link rel="preconnect" href="//fastly.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.5.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.staticfile.org/fancyapps-ui/5.0.32/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":false,"top_n_per_article":1,"unescape":false,"languages":{"hits_empty":"找不到您查询的内容：${query}","hits_stats":"共找到 ${hits} 篇文章"}},
  translate: {"defaultEncoding":1,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"简"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":200},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: true
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  infinitegrid: {
    js: 'https://cdn.staticfile.org/egjs-infinitegrid/4.11.0/infinitegrid.min.js',
    buttonText: '加载更多'
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: true,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '分类: 使用教程',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2024-02-03 12:56:35'
}</script><script>(win=>{
      win.saveToLocal = {
        set: (key, value, ttl) => {
          if (ttl === 0) return
          const now = Date.now()
          const expiry = now + ttl * 86400000
          const item = {
            value,
            expiry
          }
          localStorage.setItem(key, JSON.stringify(item))
        },
      
        get: key => {
          const itemStr = localStorage.getItem(key)
      
          if (!itemStr) {
            return undefined
          }
          const item = JSON.parse(itemStr)
          const now = Date.now()
      
          if (now > item.expiry) {
            localStorage.removeItem(key)
            return undefined
          }
          return item.value
        }
      }
    
      win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.src = url
        script.async = true
        script.onerror = reject
        script.onload = script.onreadystatechange = function() {
          const loadState = this.readyState
          if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
          script.onload = script.onreadystatechange = null
          resolve()
        }

        Object.keys(attr).forEach(key => {
          script.setAttribute(key, attr[key])
        })

        document.head.appendChild(script)
      })
    
      win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
        const link = document.createElement('link')
        link.rel = 'stylesheet'
        link.href = url
        if (id) link.id = id
        link.onerror = reject
        link.onload = link.onreadystatechange = function() {
          const loadState = this.readyState
          if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
          link.onload = link.onreadystatechange = null
          resolve()
        }
        document.head.appendChild(link)
      })
    
      win.activateDarkMode = () => {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = () => {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
        if (t === 'dark') activateDarkMode()
        else if (t === 'light') activateLightMode()
      
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
      const detectApple = () => {
        if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
          document.documentElement.classList.add('apple')
        }
      }
      detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><script>(()=>{
  const $loadingBox = document.getElementById('loading-box')
  const $body = document.body
  const preloader = {
    endLoading: () => {
      $body.style.overflow = ''
      $loadingBox.classList.add('loaded')
    },
    initLoading: () => {
      $body.style.overflow = 'hidden'
      $loadingBox.classList.remove('loaded')
    }
  }

  preloader.initLoading()
  window.addEventListener('load',() => { preloader.endLoading() })

  if (false) {
    document.addEventListener('pjax:send', () => { preloader.initLoading() })
    document.addEventListener('pjax:complete', () => { preloader.endLoading() })
  }
})()</script><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/%E5%A4%B4%E5%83%8F/%E7%81%B0%E5%A4%AA%E7%8B%BC.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">120</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">4</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">22</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-tools"></i><span> 工具</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/md_editor/"><i class="fa-fw fas fa-pen"></i><span> MDEditor_my</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="not-top-img" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="小小程序员"><span class="site-name">小小程序员</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-tools"></i><span> 工具</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/md_editor/"><i class="fa-fw fas fa-pen"></i><span> MDEditor_my</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><main class="layout" id="content-inner"><div id="post"><div id="post-info"><h1 class="post-title">Obsition + Hexo 上传</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-11-29T12:01:29.000Z" title="发表于 2023-11-29 20:01:29">2023-11-29</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-02-03T04:56:35.999Z" title="更新于 2024-02-03 12:56:35">2024-02-03</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/">使用教程</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">2.5k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>8分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Obsition + Hexo 上传"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div><article class="post-content" id="article-container"><p>已完成教程：</p>
<ol>
<li><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/554333805">https://zhuanlan.zhihu.com/p/554333805</a></li>
<li><a target="_blank" rel="noopener" href="https://juejin.cn/post/7120189614660255781#heading-8">Hexo + Obsidian + Git 完美的博客部署与编辑方案 - 掘金 (juejin.cn)</a><br>未完成教程：<a target="_blank" rel="noopener" href="https://aerosand.cn/posts/202201301024/">Hexo&amp;Obsidian不完全工作流 | 𝓐𝓮𝓻𝓸𝓼𝓪𝓷𝓭 (aerosand.cn)</a></li>
</ol>
<h2 id="1-目录结构"><a href="#1-目录结构" class="headerlink" title="1.目录结构"></a>1.目录结构</h2><p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-50-41_b4962e9ed4fd832562a28bc7e51609d7_iRM6fjGVxG.png" alt="Pasted image 20231129200626.png"></p>
<p>打开 obsition</p>
<h2 id="2-忽略多余的文件"><a href="#2-忽略多余的文件" class="headerlink" title="2.忽略多余的文件"></a>2.忽略多余的文件</h2><p>我们主要是编辑和管理Markdown文件，所以一些多余的文件要忽略掉，这样在知识库里搜索文件、关键字时才不会搜索到多余的，也能有效提高检索效率。</p>
<p>打开 设置&gt;文件与链接&gt;Exclude Files</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-51-28_da9ef09fd724fd0b8792aca24840f5a6_mz3XXvUEJ7.png" alt="image.png"></p>
<p>文章都在source下，所以只保留source，其它的忽略掉</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-51-44_a283c15cd18057b0d0143b62ff00175f_YAN2tFEEBm.png" alt="Pasted image 20231129200738.png"></p>
<h2 id="3-博客文章管理"><a href="#3-博客文章管理" class="headerlink" title="3.博客文章管理"></a>3.博客文章管理</h2><h3 id="3-1-新建文章"><a href="#3-1-新建文章" class="headerlink" title="3.1 新建文章"></a>3.1 新建文章</h3><p>新建Markdown文件就很方便了：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-52-04_6cc00735cd89b25bb690f01237c42fcc_wGuP6FoxPl.png" alt="image.png"></p>
<p>可以设置下新建Markdown文件生成的位置：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-52-16_7c8de5dccf5b1888c04369ebfc187b94_Oc7RJf8W6l.png" alt="Pasted image 20231129200840.png"></p>
<h3 id="3-2-快速插入Front-matter模板"><a href="#3-2-快速插入Front-matter模板" class="headerlink" title="3.2 快速插入Front-matter模板"></a>3.2 快速插入Front-matter模板</h3><p>Obsidian有一个模板功能，允许我们预先写好一些内容模板，写文章时可以随时快捷插入。</p>
<p>在核心插件中开启模板功能：</p>
<p>打开模板插件的设置界面，设置模板文件夹位置以及日期格式：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-52-27_71621581310f8d94c247895794854868_d1NcYhUq5V.png" alt="Pasted image 20231129200916.png"></p>
<p>编写Front-matter模板：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-52-37_e0d364bad82c18cdffd1c5f40f5eec52_QXbBG4iey7.png" alt="Pasted image 20231129200939.png"></p>
<p>在左侧菜单栏中点插入模板：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-52-43_6ccf74485759c78bcefc41e18914a014_rFBf9ALhll.png" alt="Pasted image 20231129201024.png"></p>
<h2 id="4-Obsidian-Git插件的使用"><a href="#4-Obsidian-Git插件的使用" class="headerlink" title="4.Obsidian Git插件的使用"></a>4.Obsidian Git插件的使用</h2><p>Obsidian知识库多端同步，我之前一直用的方案是OnDrive，除了.obsidian文件夹下个别文件会出现冲突以外，各方面都挺不错的。但是现在加入了Hexo博客后，冲突恐怕会更多，OnDrive没法处理，显然用Git来管理会更好，还有Hexo博客要部署到服务器一般也是用Git。</p>
<p>得益于Obsidian强大的插件生态，我们可以在Obsidian中直接操作Git，用到的是一款社区插件，叫做Obsidian Git</p>
<h3 id="4-1-安装"><a href="#4-1-安装" class="headerlink" title="4.1 安装"></a>4.1 安装</h3><p>先设置里启用社区插件功能，然后再搜索安装即可：<br><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-53-10_a397de9094fb9cfc96bc64403442321e_4Md0uHGWH0.png" alt="Pasted image 20231129201146.png"></p>
<p>要确保知识库是一个Git仓库，打开才不会报如下错误：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-53-31_2facdf880315d4d56f4b7cb500e1f6a3_t4ur0UcKiQ.png" alt="image.png"></p>
<h3 id="4-2-忽略配置"><a href="#4-2-忽略配置" class="headerlink" title="4.2 忽略配置"></a>4.2 忽略配置</h3><p>根目录目录下创建<code>.gitignore</code>， </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">.DS_Store</span><br><span class="line">Thumbs.db</span><br><span class="line">db.json</span><br><span class="line">*.log</span><br><span class="line">node_modules/</span><br><span class="line">public/</span><br><span class="line">.deploy*/</span><br><span class="line">_multiconfig.yml</span><br></pre></td></tr></table></figure>
<p>忽略掉<code>.obsidian/workspace</code></p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-53-42_56ca4cda6c9a3458809e0a10842bfd66_EGjCxX4lNA.png" alt="Pasted image 20231129201213.png"></p>
<h3 id="4-3-使用"><a href="#4-3-使用" class="headerlink" title="4.3 使用"></a>4.3 使用</h3><p>打开插件设置界面，可以修改一下自动提交和手动提交的日志，我设置的是主机名+日期：</p>
<p>在提交信息设置里，可以修改主机名和日期格式，修改完成后点Preview可以预览提交信息：</p>
<p>快捷键<code>Ctrl + P</code>打开命令面板，输入open source control view启用可视化操作面板：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-54-01_58713ce23c9e5af3b6b8c952e293a93c_hda2RRj0Cy.png" alt="image.png"></p>
<p>然后在右侧菜单栏就可以看到操作面板了：<br><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-54-11_eec375fd89c039df75b6a3603b174700_V7JRIbXC3X.png" alt="Pasted image 20231129201355.png"></p>
<p>一般操作就是：保存所有&gt;提交&gt;推送，就可以更新到Git服务器了，如下图顺序</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-54-35_18da7d6abc31833be21883ae155544de_ZLQwJbmXEA.png" alt="image.png"></p>
<p>启用自动拉取功能，每次打开知识库就会自动拉取：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-54-54_1e2b88941348d59ba3ccca5d226fef80_0obeq2mPzL.png" alt="image.png"></p>
<p>如果在使用过程中有报错的话，<code>Ctrl+Shift+I</code>在控制台里可以查看详细日志，所有插件的日志都可以在这里看到：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-55-08_a8547de6c630b0c0e99668329416d9af_CxOOa9xRbF.png" alt="image.png"></p>
<h2 id="5-自动更新Front-matter分类信息"><a href="#5-自动更新Front-matter分类信息" class="headerlink" title="5.自动更新Front-matter分类信息"></a>5.自动更新Front-matter分类信息</h2><p>前文我们实现了Front-matter模板的快速插入，但是有些变量如categories还是需要手动维护。结合Obsidian，最好的方案就是我们通过文件夹来对文章进行分类，然后自动生成和更新Front-matter的分类信息。</p>
<h3 id="5-1-hexo-auto-category安装与配置"><a href="#5-1-hexo-auto-category安装与配置" class="headerlink" title="5.1 hexo-auto-category安装与配置"></a>5.1 hexo-auto-category安装与配置</h3><p>这里我们使用的是<a target="_blank" rel="noopener" href="https://github.com/xu-song/hexo-auto-category">hexo-auto-category</a>这个基于文件夹自动分类的插件，安装：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-auto-category --save</span><br></pre></td></tr></table></figure>

<p>在站点配置文件 中添加配置：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"># Generate categories from directory-tree</span><br><span class="line"># Dependencies: https://github.com/xu-song/hexo-auto-category</span><br><span class="line"># depth: the max_depth of directory-tree you want to generate, should &gt; 0</span><br><span class="line"></span><br><span class="line">auto_category:</span><br><span class="line"> enable: true</span><br><span class="line"> depth:</span><br></pre></td></tr></table></figure>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-55-22_0e248f2e061f8fbfe05c1264aec306aa_WFIflDRNPS.png" alt="Pasted image 20231129201446.png"></p>
<h2 id="6利用Git钩子函数触发更新"><a href="#6利用Git钩子函数触发更新" class="headerlink" title="6利用Git钩子函数触发更新"></a>6利用Git钩子函数触发更新</h2><h3 id="6-1-根据文件目录自动生成-categories-信息"><a href="#6-1-根据文件目录自动生成-categories-信息" class="headerlink" title="6.1 根据文件目录自动生成 categories 信息"></a>6.1 根据文件目录自动生成 categories 信息</h3><p>虽然我们把文章放的井井有条了，但是每个文章里的 <code>categorys</code> 字段还是要我们手动自己维护的，比如在 <code>source/_post/前端/Javascript/Javascript原型链机制.md</code> 文件中，我们要通过手写 <code>categories</code> 来让 hexo 知道这篇文章被放在 <code>前端-Javascript</code> 分类下：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">title: Javascript原型链机制</span><br><span class="line">categories:   </span><br><span class="line">	- 前端   </span><br><span class="line">	- Javascript </span><br><span class="line">date: 2022-06-05 12:06:47 </span><br><span class="line"></span><br><span class="line">这里是正文`</span><br></pre></td></tr></table></figure>

<p>为了省去手动维护 <code>categorys</code> 字段的这个问题，我们可以使用 <a href="https://link.juejin.cn/?target=hexo-auto-category" title="hexo-auto-category">hexo-auto-category</a> 这个插件。这个插件在 Hexo 进行 build 的时候会去自动根据文章目录情况来自动修改文章的 <code>categories</code> 信息，更详细的部分可以看<a href="https://link.juejin.cn/?target=https://blog.eson.org/pub/e2f6e239/" title="https://blog.eson.org/pub/e2f6e239/">作者的文章</a>。</p>
<p>除此之外最好修改一下 <code>_config.yml</code> 中的两处默认配置：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># 修改 permalink 让你的文章链接更加友好，并且有益于 SEO </span><br><span class="line">permalink: :year/:month/:hash.html </span><br><span class="line"></span><br><span class="line"># 规定你的新文章在 _post 目录下是以 </span><br><span class="line">cateory  new_post_name: :category/:title`</span><br></pre></td></tr></table></figure>

<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-55-34_06f0ac17f27025ec0902ba8898034981_EA0SihAs08.png" alt="Pasted image 20231129201957.png"></p>
<h3 id="6-2-提交代码时自动生成新文章的-categories"><a href="#6-2-提交代码时自动生成新文章的-categories" class="headerlink" title="6.2 提交代码时自动生成新文章的 categories"></a>6.2 提交代码时自动生成新文章的 categories</h3><p>但是这里有一个问题，就是只有 hexo 在执行 <code>hexo generate</code> 或者 <code>hexo server</code> 时候才会去触发 <code>categories</code> 的生成，那么每次我们创建文章都要经历这样的工作流：</p>
<ol>
<li>创建分类目录，写文章，文件名推荐与文章标题一致（不用关心 <code>categories</code> 写什么）；</li>
<li>填写 <code>title</code>、<code>date</code>、<code>tag</code> 等元信息（这个文章后续再讨论如何省去这一步）;</li>
<li>执行 <code>npx hexo generate</code> 在构建博客的时候触发 <code>hexo-auto-category</code> 插件的自动矫正 <code>categories</code> 功能；</li>
<li>检查文章中的 <code>categories</code> 是否正确；</li>
<li>添加 git 工作区变更，并提交并推送代码到 github。</li>
</ol>
<p>为了简化这些工作，我们可以使用 git hook，在我们每次执行 <code>commit</code> 前都自动运行 <code>npx hexo generate</code> 触发自动生成 <code>categories</code> 的行为，并将生成后的变更自动添加到本次提交中，然后一同 push 到 github 上去。这里可以使用 husky 来很方便的设置这样一个 git hook。</p>
<blockquote>
<p>GitHook 可以在执行代码的 commit、push、rebase 等阶段前触发，做一些前置行为，比如在每次提交代码时候执行一段 shell 脚本，来做一些代码检查或者通知 ci 等操作。</p>
<p>Husky 采用了更简单的一种方式，让管理 GitHook 更加现代化</p>
<p>关于 Husky 的使用可以参考我之前的文章<a href="https://link.juejin.cn/?target=https://blog.esunr.xyz/2022/05/d36522b1089c.html" title="https://blog.esunr.xyz/2022/05/d36522b1089c.html">《使用 husky 每次提交时进行代码检查》</a></p>
</blockquote>
<p>你可以按照如下步骤快速完成设置：</p>
<ol>
<li>安装 huksy：<code>npm install husky --save-dev</code></li>
<li>执行 huksy 初始化指令：<code>npx husky install</code></li>
<li>在 <code>package.json</code> 中的 <code>scripts</code> 中写入：<code>&quot;prepare&quot;: &quot;husky install&quot;</code></li>
<li>在生成的 <code>.husky</code> 目录创建 <code>pre-commit</code> 文件（有的话就不用创建），并写入以下内容：</li>
</ol>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">#!/usr/bin/env sh</span><br><span class="line">. &quot;$(dirname -- &quot;$0&quot;)/_/husky.sh&quot;</span><br><span class="line"></span><br><span class="line">npx hexo generate &amp;&amp; git add .</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>如果提交代码的时候，终端出现类似的构建过程，就说明由 husky 创建的 git hook 生效了：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-55-45_c2c0f8c4974d0b50bf525b03c9baf0cc_TM2gfMDrXp.awebp"></p>
<p>这样你新建一篇博客的工作流就简化为：</p>
<ol>
<li>创建分类目录，写文章；</li>
<li>填写 <code>title</code>、<code>date</code>、<code>tag</code> 等元信息;</li>
<li>添加 git 工作区变更，并提交并推送代码到 github。</li>
</ol>
<p>这样就解决了令人头疼的文章分类问题~</p>
<h2 id="7-使用-File-Tree-插件"><a href="#7-使用-File-Tree-插件" class="headerlink" title="7 使用 File Tree 插件"></a>7 使用 File Tree 插件</h2><p>Obsidian 很不好的一点就是会把所有的文件都列在左侧的文件列表中，但是对于我们的 Hexo 项目写文章来说，我们只会修改 <code>_post</code> 目录下的文件，因此我们希望左侧的文件列表中只显示 <code>_post</code> 文件夹，但是目前为止 Obsidian 并没有推出类似『聚焦』到某一文件夹内的功能。</p>
<p>好在 Obsidian 强大的插件库中有一个 <code>File Tree Alternative Plugin</code> 第三方插件可以满足这一需求。按照 Obsidian Git 相同的方法去下载这个第三方插件，下载完成之后我们会发现左侧菜单出现了一个 <code>File Tree</code> 的 Tab 页，点击后就可以看到文件以树形的结构呈现：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-55-51_e315bd30446d8b598b1f382350f8c33f_hJZJ3GxiIh.awebp"></p>
<p>我们展开 <code>source</code> 文件夹，并右键 <code>_post</code> 文件夹，选择 <code>Focuse on Folder</code> 后，左侧的文件列表中就只会显示 <code>_post</code> 文件夹中的内容了：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-56-02_98d5d5370520724868afda55e2d84e97_b6LP0ejek9.awebp"></p>
<h2 id="8-快捷操作"><a href="#8-快捷操作" class="headerlink" title="8.快捷操作"></a>8.快捷操作</h2><p>Obsidian中通过URL可以访问链接或打开文件，所以我们可以在根目录创建一个Markdown文件，相当于我们知识库的主页，把一些常用的链接放这里，方便快速访问：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-56-10_c4ca4238a0b923820dcc509a6f75849b_RnXbp2voGh"></p>
<blockquote>
<p><strong>在写URL的时候要注意：如果路径有空格的话，要替换为%20</strong></p>
</blockquote>
<h3 id="8-1-快捷打开站点或主题配置文件"><a href="#8-1-快捷打开站点或主题配置文件" class="headerlink" title="8.1 快捷打开站点或主题配置文件"></a>8.1 快捷打开站点或主题配置文件</h3><p>站点配置文件和主题配置文件是我们DIY博客经常要编辑的两个文件，在Obsidian中没法编辑yml文件，可以通过URL来打开yml文件，会自动调用默认的编辑器打开。</p>
<p>在主页Markdown中，按Ctrl+K插入链接，写入我们两个配置文件所在的相对路径：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">[打开站点配置文件](Blog/_config.yml)</span><br><span class="line">[打开主题配置文件](Blog/themes/butterfly4.3.1/_config.yml)</span><br><span class="line"></span><br><span class="line"># 或者写成Obsidian URI的形式</span><br><span class="line">[打开站点配置文件](obsidian://open?file=Blog/_config.yml)</span><br><span class="line">[打开主题配置文件](obsidian://open?file=Blog/themes/butterfly4.3.1/_config.yml)</span><br></pre></td></tr></table></figure>

<p>效果演示：</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-56-16_c4ca4238a0b923820dcc509a6f75849b_QfAxr3Z9ja" alt="动图封面"></p>
<h3 id="8-2-快捷运行博客"><a href="#8-2-快捷运行博客" class="headerlink" title="8.2 快捷运行博客"></a>8.2 快捷运行博客</h3><p>我们还可以运行bat文件来执行一些命令，比如运行我们的博客了。</p>
<p>在我们的Hexo博客目录下，创建一个<code>RunBlog.bat</code>文件，写入以下命令：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">start http://localhost:4000/</span><br><span class="line">hexo s</span><br></pre></td></tr></table></figure>

<p>然后在我们的主页添加链接：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[运行博客](Blog/RunBlog.bat)</span><br><span class="line"></span><br><span class="line"># 或者</span><br><span class="line">[运行博客](obsidian://open?file=Blog/RunBlog.bat)</span><br></pre></td></tr></table></figure>

<p>效果演示：（测试完成后，按两次Ctrl+C关闭）</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-56-26_c4ca4238a0b923820dcc509a6f75849b_AqdbbFmbJT" alt="动图封面"></p>
<h3 id="8-3-优化方案"><a href="#8-3-优化方案" class="headerlink" title="8.3 优化方案"></a>8.3 优化方案</h3><h3 id="8-3-1-嵌入文件"><a href="#8-3-1-嵌入文件" class="headerlink" title="8.3.1 嵌入文件"></a>8.3.1 嵌入文件</h3><p>觉得链接太小了不好点击？Obsidian嵌入文件完美解决，只需在链接前加上感叹号!（注意嵌入文件的链接就不能用Obsidian URI的形式了）</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">打开站点配置文件</span><br><span class="line">![打开站点配置文件](_config.yml)</span><br><span class="line">打开主题配置文件</span><br><span class="line">![打开主题配置文件](themes/butterfly/_config.yml)</span><br><span class="line">运行博客命令</span><br><span class="line">![运行博客](RunBlog.bat)</span><br></pre></td></tr></table></figure>

<p>是不是瞬间舒服多了？</p>
<p><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/obsition/2024-02-03_12-56-34_c4ca4238a0b923820dcc509a6f75849b_hfIuPa0LJt"></p>
<h4 id="注意：-运行博客命令后，cmd闪退，表示配置文件有误"><a href="#注意：-运行博客命令后，cmd闪退，表示配置文件有误" class="headerlink" title="注意： 运行博客命令后，cmd闪退，表示配置文件有误"></a>注意： 运行博客命令后，cmd闪退，表示配置文件有误</h4></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="https://ko25891wan.gitlab.io">十一星野</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="https://ko25891wan.gitlab.io/2023/11/fd3f0b9d3591.html">https://ko25891wan.gitlab.io/2023/11/fd3f0b9d3591.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://ko25891wan.gitlab.io" target="_blank">小小程序员</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/11/896d5e4839d3.html" title="添加第二篇博客"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">添加第二篇博客</div></div></a></div><div class="next-post pull-right"><a href="/2023/11/969208c6cad2.html" title="内容1"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">内容1</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://qiniu.ko25891wan.top/%E6%97%A5%E8%AE%B0%E8%BD%AF%E4%BB%B6/%E5%A4%B4%E5%83%8F/%E7%81%B0%E5%A4%AA%E7%8B%BC.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">十一星野</div><div class="author-info__description">归途也还可爱</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">120</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">4</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">22</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://gitlab.com/ko25891wan/ko25891wan.gitlab.io"><i class="fab fa-github"></i><span>关注我</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://gitlab.com/ko25891wan/ko25891wan.gitlab.io" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="https://gitlab.com/ko25891wan/ko25891wan.gitlab.io" target="_blank" title="Gitlab"><i class="fab fa-gitlab" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:ko25891wan@outlook.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84"><span class="toc-number">1.</span> <span class="toc-text">1.目录结构</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E5%BF%BD%E7%95%A5%E5%A4%9A%E4%BD%99%E7%9A%84%E6%96%87%E4%BB%B6"><span class="toc-number">2.</span> <span class="toc-text">2.忽略多余的文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-%E5%8D%9A%E5%AE%A2%E6%96%87%E7%AB%A0%E7%AE%A1%E7%90%86"><span class="toc-number">3.</span> <span class="toc-text">3.博客文章管理</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#3-1-%E6%96%B0%E5%BB%BA%E6%96%87%E7%AB%A0"><span class="toc-number">3.1.</span> <span class="toc-text">3.1 新建文章</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-2-%E5%BF%AB%E9%80%9F%E6%8F%92%E5%85%A5Front-matter%E6%A8%A1%E6%9D%BF"><span class="toc-number">3.2.</span> <span class="toc-text">3.2 快速插入Front-matter模板</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-Obsidian-Git%E6%8F%92%E4%BB%B6%E7%9A%84%E4%BD%BF%E7%94%A8"><span class="toc-number">4.</span> <span class="toc-text">4.Obsidian Git插件的使用</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#4-1-%E5%AE%89%E8%A3%85"><span class="toc-number">4.1.</span> <span class="toc-text">4.1 安装</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-2-%E5%BF%BD%E7%95%A5%E9%85%8D%E7%BD%AE"><span class="toc-number">4.2.</span> <span class="toc-text">4.2 忽略配置</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-3-%E4%BD%BF%E7%94%A8"><span class="toc-number">4.3.</span> <span class="toc-text">4.3 使用</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-%E8%87%AA%E5%8A%A8%E6%9B%B4%E6%96%B0Front-matter%E5%88%86%E7%B1%BB%E4%BF%A1%E6%81%AF"><span class="toc-number">5.</span> <span class="toc-text">5.自动更新Front-matter分类信息</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#5-1-hexo-auto-category%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE"><span class="toc-number">5.1.</span> <span class="toc-text">5.1 hexo-auto-category安装与配置</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#6%E5%88%A9%E7%94%A8Git%E9%92%A9%E5%AD%90%E5%87%BD%E6%95%B0%E8%A7%A6%E5%8F%91%E6%9B%B4%E6%96%B0"><span class="toc-number">6.</span> <span class="toc-text">6利用Git钩子函数触发更新</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#6-1-%E6%A0%B9%E6%8D%AE%E6%96%87%E4%BB%B6%E7%9B%AE%E5%BD%95%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90-categories-%E4%BF%A1%E6%81%AF"><span class="toc-number">6.1.</span> <span class="toc-text">6.1 根据文件目录自动生成 categories 信息</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#6-2-%E6%8F%90%E4%BA%A4%E4%BB%A3%E7%A0%81%E6%97%B6%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90%E6%96%B0%E6%96%87%E7%AB%A0%E7%9A%84-categories"><span class="toc-number">6.2.</span> <span class="toc-text">6.2 提交代码时自动生成新文章的 categories</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#7-%E4%BD%BF%E7%94%A8-File-Tree-%E6%8F%92%E4%BB%B6"><span class="toc-number">7.</span> <span class="toc-text">7 使用 File Tree 插件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#8-%E5%BF%AB%E6%8D%B7%E6%93%8D%E4%BD%9C"><span class="toc-number">8.</span> <span class="toc-text">8.快捷操作</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#8-1-%E5%BF%AB%E6%8D%B7%E6%89%93%E5%BC%80%E7%AB%99%E7%82%B9%E6%88%96%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-number">8.1.</span> <span class="toc-text">8.1 快捷打开站点或主题配置文件</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#8-2-%E5%BF%AB%E6%8D%B7%E8%BF%90%E8%A1%8C%E5%8D%9A%E5%AE%A2"><span class="toc-number">8.2.</span> <span class="toc-text">8.2 快捷运行博客</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#8-3-%E4%BC%98%E5%8C%96%E6%96%B9%E6%A1%88"><span class="toc-number">8.3.</span> <span class="toc-text">8.3 优化方案</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#8-3-1-%E5%B5%8C%E5%85%A5%E6%96%87%E4%BB%B6"><span class="toc-number">8.4.</span> <span class="toc-text">8.3.1 嵌入文件</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%B3%A8%E6%84%8F%EF%BC%9A-%E8%BF%90%E8%A1%8C%E5%8D%9A%E5%AE%A2%E5%91%BD%E4%BB%A4%E5%90%8E%EF%BC%8Ccmd%E9%97%AA%E9%80%80%EF%BC%8C%E8%A1%A8%E7%A4%BA%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E6%9C%89%E8%AF%AF"><span class="toc-number">8.4.1.</span> <span class="toc-text">注意： 运行博客命令后，cmd闪退，表示配置文件有误</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2024/02/c60470b9a892.html" title="Java集合使用注意事项总结">Java集合使用注意事项总结</a><time datetime="2024-02-03T04:58:22.000Z" title="发表于 2024-02-03 12:58:22">2024-02-03</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2024/02/81fb7a201f29.html" title="无题">无题</a><time datetime="2024-02-03T03:15:31.812Z" title="发表于 2024-02-03 11:15:31">2024-02-03</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2024/01/5737c1ec69a9.html" title="Wed Jan 17 2024 00:00:00 GMT+0800 (中国标准时间)">Wed Jan 17 2024 00:00:00 GMT+0800 (中国标准时间)</a><time datetime="2024-01-31T06:56:16.000Z" title="发表于 2024-01-31 14:56:16">2024-01-31</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2024/01/f510db7d2f19.html" title="Spring常见面试题总结">Spring常见面试题总结</a><time datetime="2024-01-31T06:55:58.000Z" title="发表于 2024-01-31 14:55:58">2024-01-31</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2024/01/9be065e9f288.html" title="redis 面试">redis 面试</a><time datetime="2024-01-31T06:55:55.000Z" title="发表于 2024-01-31 14:55:55">2024-01-31</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2023 - 2024 By 十一星野</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.staticfile.org/fancyapps-ui/5.0.32/fancybox/fancybox.umd.min.js"></script><script src="https://cdn.staticfile.org/instant.page/5.2.0/instantpage.min.js" type="module"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div></body></html>